package com.easy.neo4j.vo;

import com.easy.neo4j.entry.Park;
import com.easy.neo4j.entry.bus.SiteReader;
import com.easy.neo4j.entry.dt.Subway;
import com.easy.neo4j.entry.PowerBike;

import java.util.HashSet;
import java.util.Set;

/**
 * @Author: CoolPro
 * @Description: 路线规划返回值
 * @Time: 2024-03-28 11:02
 **/

public class RouteSchemeVO {
    private String[] startNode;//起始节点的经纬度
    private String[] endNode;//结束节点的经纬度
    private String schemeType;//路线规划类型 [bike:共享单车优先,bus:公交优先,subway:地铁优先]
    private Set<PowerBike> bikes;//共享单车
    private Set<Park> bikeParks;//单车停放点
    private Set<SiteReader> busStations;//公交站点
    private Set<Subway> subwayStations;//地铁站点
    private Integer numberOfMilesRidden = 0;//可骑行里程数(公里)
    public RouteSchemeVO() {
        this.startNode = new String[2];
        this.endNode = new String[2];
        bikes = new HashSet<>();
        bikeParks =new HashSet<>();
        busStations = new HashSet<>();
        subwayStations = new HashSet<>();
    }

    public String[] getStartNode() {
        return startNode;
    }

    public RouteSchemeVO setStartNode(String[] startNode) {
        this.startNode = startNode;
        return this;
    }

    public String[] getEndNode() {
        return endNode;
    }

    public RouteSchemeVO setEndNode(String[] endNode) {
        this.endNode = endNode;
        return this;
    }

    public String getSchemeType() {
        return schemeType;
    }

    public RouteSchemeVO setSchemeType(String schemeType) {
        this.schemeType = schemeType;
        return this;
    }

    public Set<Park> getBikeParks() {
        return bikeParks;
    }

    public RouteSchemeVO setBikePark(Park bikePark) {
        this.bikeParks.add(bikePark);
        return this;
    }

    public Set<SiteReader> getBusStations() {
        return busStations;
    }

    public RouteSchemeVO setBusStation(SiteReader busStation) {
        this.busStations.add(busStation);
        return this;
    }

    public Set<Subway> getSubwayStations() {
        return subwayStations;
    }

    public RouteSchemeVO setSubwayStation(Subway subwayStation) {
        this.subwayStations.add(subwayStation);
        return this;
    }

    public Set<PowerBike> getBikes() {
        return bikes;
    }

    public RouteSchemeVO setBike(PowerBike bike) {
        this.bikes.add(bike);
        setNumberOfMilesRidden(Integer.parseInt(bike.getMileage()));
        return this;
    }

    public Integer getNumberOfMilesRidden() {
        return numberOfMilesRidden;
    }

    public void setNumberOfMilesRidden(Integer numberOfMilesRidden) {
        this.numberOfMilesRidden += numberOfMilesRidden;
    }
    //    /**
//     * @Author: CoolPro
//     * @Date: 28/3/2024
//     * @Description:  更新最佳的单车结果
//     * @Name: updateBikes
//     * @param bike
//     * @param park
//     * @return: com.eazy.eazydemo.vo.RouteSchemeVO
//    */
//
//    public RouteSchemeVO updateBikes(PowerBike bike, Park park) {
//        this.bikes =new ArrayList<>();
//        this.bikeParks = new ArrayList<>();
//        this.bikes.add(bike);
//        this.bikeParks.add(park);
//        return this;
//    }
}
